import os

# path = 'file.txt'
# file = os.path.splitext(path)
# filename, type = file
# print(filename)
# print(type)


# before_download = os.path.join(scriptpath, "before_download.sh")
# with open(before_download, mode='w', encoding='utf-8') as f:
#     f.write(taskinfo.before_download)
# file = '/Users/dayang/PycharmProjects/Devops/test1.sh'
# with open(file, mode='w', encoding='utf-8') as f:
#     f.write("22223333")

def check(file):
    file = os.path.splitext(file)
    filename, type = file
    if type == '.sh':
        print("this is shell")
    else:
        print("this is python")


check('testh.py')
